The present invention relates generally to encoding and decoding bar codes, and more particularly to a system and method for encoding and decoding multi-level bar codes having multiple gray levels using pulse width modulation.
Methods for encoding information on a printed page with a laser printer are subject to the limitations of the printing mechanism. Among these limitations, with respect to monochrome electrophotographic printers, is the limitation of only printing black or white dots at or near the maximum resolution of a device.
For high capacity spatial data encoding, there are several variables that would allow for a higher data density to be achieved, including compression, resolution and bits per pixel. Compression of pseudo-random or unknown data is typically maximized using existing techniques, such as Run-Length-Encoding or Huffman Encoding, beyond which data loss can occur. Increased resolution can be difficult to obtain without significant expense with respect to laser printing because it requires improvements in areas such as the mirror spin rate, the laser spot size, the dot shape, noise factors in the printing process, and the electrophotographic process itself. On the scanning side, increasing resolution would require reduction of noise in the scanning process and improvements in the scanner resolution. With respect to bits per pixel, monochrome laser printers typically only achieve one bit per pixel, i.e., a binary representation based on black and white pixels.
Even though monochrome laser printers are limited to printing black and white dots, these printers can simulate levels of gray by creating a halftone cell of black and white dots. Techniques for simulating the gray levels include variations of dithering and error diffusion. Such techniques, however, decrease the maximum resolution and capacity of the encoding because gray pixels are made from cells of multiple black and white dots.
Briefly, a method for developing a bar code representing the encoding of a set of data, the bar code including pixels having one black level, one white level and at least one gray level, generates a multi-level data representation of the set of data, the number of levels corresponding to the sum of the black level, the white level and the number of gray levels. A pixel color is determined for each component of the multi-level data representation, a pixel color for at least one of the components being one of the at least one gray levels. The determined pixel color is then printed for each component to form the bar code.
In another aspect of the invention, the set of data is converted into a base corresponding to the numbers of levels of the multi-level data.
In yet another aspect of the invention, the printing of each pixel includes modulating a laser, and keeping the laser on for less that a full period t for each pixel having a gray level. The laser is kept on for a first portion of the period t for a first pixel having a first gray level and is kept on for a second portion of the period t for a second pixel having a second gray level, wherein the first portion is longer than the second portion if the first pixel is darker than the second pixel.